package 力扣日常刷题.木22二月.第01天206;

/**
 * @author 帅小伙
 * @date 2022/2/6
 * @description
 */
public class Demo14JZ青蛙跳台阶问题 {

    public int numWays(int n) {
        if(n == 0) return 1;
        final int MOD = 1000000007;
        int a = 1,b = 2;

        for (int i = 1; i < n; i++) {
            int t = b;
            b = (a + b) % MOD;
            a = t % MOD;
        }
        return a;
    }

}
